package ASE;

public class Desk {
	int num ;
	Que <Booking>que ;
	String Report ;
	public Desk(Que <Booking> que)
	{
		this.que = que ;
		this.num = 1 ;
		this.ProcessTheQueue();
	
	}
	
	public void ProcessTheQueue()
	{
	 while (!this.que.isEmpty())
	 { 
		Booking b =this.que.dequeue();
		b.extrafee = CheckLuggage(b.passenger.luggage);
		Report = b.toString()+"\n" ;
       System.out.println (b.passenger.name +"   "+b.extrafee );
		 
	 }
	// writeReport();
	 
	}
	
	public double CheckLuggage (Luggage L)
	{
		return checkLength(L.length)+ checkWedth(L.width)+ checkHigh(L.High) + checkWeight(L.weight) ;
	}
	public double checkLength(double lengh)
	{
		if(lengh > 90)
		{
			return (lengh-90)* 2 ;
		}
		else 
			return 0.0 ;
	}
	public double checkWedth(double wedth)
	{
		if(wedth > 40)
		{
			return (wedth-40)* 2 ;
		}
		else 
			return 0.0 ;
	}
	public double checkHigh(double high)
	{
		if(high > 20)
		{
			return (high-20)* 2 ;
		}
		else 
			return 0.0 ;
	}
	public double checkWeight(double weight)
	{
		if(weight > 20)
		{
			return (weight-20)* 2 ;
		}
		else 
			return 0.0 ;
	}
	public String ToString()
	{
		return "" ;
	}
	public void writeReport()
	{
	   	
	}

}
